export class LocalStorage {

    private static LocalStorage: LocalStorage;

    public static getInstance(): LocalStorage {
        if (!LocalStorage.LocalStorage) {
            LocalStorage.LocalStorage = new LocalStorage();
        }
        return this.LocalStorage;
    }
  public  LOCAL_KEY_REMEMBER_USER = "LOCAL_KEY_REMEMBER_USER";//记住我
        public  get (key:any) {
            let v = localStorage.getItem(key);
            if (v && typeof (v) !== "undefined" && v !== "undefined") {
                return JSON.parse(v);
            }
        }
        public  set (key:any, data:any) {
            localStorage.setItem(key, JSON.stringify(data));
        }
       public  remove (key:any) {
            localStorage.removeItem(key);
        }
        public  clearAll () {
            localStorage.clear();
        }

};
declare module "vue/types/vue" {
    interface Vue {
        /**
         * Http net 对象
         *
         * @type {Http}
         * @memberof Vue
         */
        $LocalStorage: LocalStorage;
    }
}
